package engine.graphics.renderable
{
	import away3d.core.managers.*;
	import engine.graphics.*;
	import engine.graphics.away3d.*;
	import flash.display3D.*;
	
	public class RxRenderableVertexBuffer extends Object implements RxRenderableBase
	{
		protected var m_vertexBuffers:Vector.<RxVertexBuffer>;
		protected var m_indexBuffer:IndexBuffer3D;
		
		public function RxRenderableVertexBuffer()
		{
			this.m_vertexBuffers = new Vector.<RxVertexBuffer>;
			this.m_indexBuffer = null;
		}
		
		public function Render(proxy:Stage3DProxy, i:uint, camera:RxCamera3D) : void
		{
			this.BindVertexBuffers(proxy);
			//proxy.DrawTriangles(this.m_indexBuffer);
		}
		
		public function BindVertexBuffers(proxy:Stage3DProxy) : void
		{
			var buffer:RxVertexBuffer = null;
			var i:uint = 0;
			var len:* = this.m_vertexBuffers.length;
			i = 0;
			while (i < len)
			{
				
				buffer = this.m_vertexBuffers[i];
				proxy.setSimpleVertexBuffer(i, buffer.m_vertexBuffer, buffer.m_format, buffer.m_offset);
				i = i + 1;
			}
		}
		
		public function SetVertexBuffer(param1:uint, param2:RxVertexBuffer) : void
		{
			this.m_vertexBuffers[param1] = param2;
		}
		
		public function SetIndexBuffer(param1:IndexBuffer3D) : void
		{
			this.m_indexBuffer = param1;
		}
	}
}